import request from "@/utils/request";

/* 批发订单---列表 */
export function bulk_order(params) {
  return request({
    url: "/dispatch/index",
    method: "get",
    params
  });
}
export function bulk_order_info(params) {
  return request({
    url: "/dispatch/info",
    method: "get",
    params
  });
}
export function bulk_order_cancel(params) {
  return request({
    url: "/dispatch/cancel",
    method: "post",
    params
  });
}
export function bulk_order_finish(data) {
  return request({
    url: "/dispatch/finish",
    method: "post",
    data: data
  });
}
export function bulk_order_finish_list(params) {
  return request({
    url: "/dispatch/finishList",
    method: "get",
    params
  });
}


// 我要批发  页面验正是否绑定
export function bulk_order_checkBind(params) {
  return request({
    url: "/dispatch/checkBind",
    method: "get",
    params
  });
}

/* 批发订单---我要批发---列表 */
export function bulk_order_list(params) {
  return request({
    url: "/dispatch/list",
    method: "get",
    params
  });
}

// 获取商品spu
export function goods_getAllGoodsSpu(params) {
  return request({
    url: "/dispatch/getGoodsSpu",
    method: "get",
    params
  });
}
export function bulk_order_addCart(params) {
  return request({
    url: "/dispatch/addCart",
    method: "post",
    params
  });
}
export function bulk_order_batchaddCart(data) {
  return request({
    url: "/dispatch/batchAddCart",
    method: "post",
    data: data
  });
}

/* 批发账单---列表 */
export function bulk_account(params) {
  return request({
    url: "/dispatch/state",
    method: "get",
    params
  });
}
export function bulk_account_info(params) {
  return request({
    url: "/dispatch/stateInfo",
    method: "get",
    params
  });
}

export function bulk_account_export(params) {
  return request({
    url: "/export/dispatch_state_info",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 批发结算单---列表 */
export function bulk_final(params) {
  return request({
    url: "/dispatch/settle",
    method: "get",
    params
  });
}
export function images_sort(data) {
  return request({
    url: "/images/sort",
    method: "post",
    data: data
  });
}
export function bulk_final_export(params) {
  return request({
    url: "/export/dispatch_settle",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 购物车 */
export function bulk_cart(params) {
  return request({
    url: "/dispatch/cart",
    method: "get",
    params
  });
}
export function bulk_cart_clean(params) {
  return request({
    url: "/dispatch/cleanCart",
    method: "post",
    params
  });
}
export function bulk_cart_del(params) {
  return request({
    url: "/dispatch/delCart",
    method: "post",
    params
  });
}

// 结算
export function bulk_cart_close(params) {
  return request({
    url: "/dispatch/closed",
    method: "get",
    params
  });
}
// 确认提交
export function bulk_cart_confirm(data) {
  return request({
    url: "/dispatch/addOrder",
    method: "post",
    data: data
  });
}
// 支付页面
export function bulk_cart_pay(params) {
  return request({
    url: "/dispatch/pay",
    method: "get",
    params
  });
}
export function bulk_query(params) {
  return request({
    url: "/dispatch/query",
    method: "get",
    params
  });
}

/* 批发订单接口导出 */

export function bulk_order_export(params) {
  return request({
    url: "/export/dispatch_list",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 批发订单接口导出 */
export function bulk_order_info_export(params) {
  return request({
    url: "/export/dispatch_info",
    method: "post",
    responseType: "blob",
    params
  });
}
